<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // 这个叫JSON字符串
        var json01 = '{ "name":"runoob", "alexa":10000, "site":"www.runoob.com" ,"age":23,"sex":false}'
        var obj01 = {
            name: 'chen',
            age: 22
        }
        for (var key in json01) {
            console.log(key);
            // console.log(json01[key]);
        }
        // json字符串转换成js对象，还可以穿一些可选的参数 百度
        console.log(JSON.parse(json01));
        // js对象转换成json
        console.log(JSON.stringify(obj01));

    </script>
</body>

</html>